<template>
  <el-dialog
    :model-value="modelValue"
    :title="title"
    :width="width"
    :before-close="handleClose"
  >
    <slot></slot>
  </el-dialog>
</template>
<script lang="ts" setup>
interface Props {
  title?: string;
  width?: number;
  cancel?: string;
  confirm?: string;
  modelValue: boolean;
}
withDefaults(defineProps<Props>(), {
  title: "标题",
  width: 500,
  cancel: "关闭",
  confirm: "确定",
});
const emit = defineEmits<{
  (e: "update:modelValue", newFormData: any): void;
  (e: "handleConfirm"): void;
}>();
const handleClose = () => {
  emit("update:modelValue", false);
};
</script>
